<template>
    <div id="navMenu">
          <el-menu
      default-active="2"
      class="el-menu-vertical-demo"
      @open="handleOpen"
      @close="handleClose"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#ffd04b">
      <el-submenu  v-for="(item,key,index) in allMenus" :key="key"
      	:index="String(index)">
        <template slot="title">
          <i class="el-icon-location"></i>
          <span>{{item.permissionDesc}}</span>
        </template>
        <el-menu-item v-for="(item1,index1) in item.children"
        	:index="index+'-'+index1"
        	@click="pushTo({name:item1.permissionDesc})">
           {{item1.permissionDesc}}
        </el-menu-item>
      </el-submenu>
    </el-menu>
    <!--//调用计算属性值-->
    <!--{{allMenus}}-->
    </div>
</template>
<script>
export default {
    methods: {
        handleOpen(){},
        handleClose(){}
    },
    mounted(){
        var menus = JSON.parse(localStorage.getItem('response')).permissions;
//      console.log(menus);
        this.$store.commit('LOADALLMENUS',menus)
    },
    computed:{
    	allMenus(){
    		return this.$store.getters.allMenus;
    	}
    }
}
</script>
<style lang="scss" scoped>

</style>
